home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / tcprogud.sit / TC Prog Guide / card_51117.txt < prev    next >
Text File  |  1991-02-27  |  600b  |  23 lines

  1. -- card: 51117 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4755
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 4
  9. ----- text -----
  10.     while (c = getchar() , c != 'x')
  11.         process_input(c);
  12.  
  13. The alternative 'do-while' statement evaluates the expression after having executed the statement once:
  14.  
  15.     do
  16.         statement
  17.         while (expression);
  18.  
  19. (Note the trailing semicolon.)  Though used less frequently than 'while' or 'for' loops, there are occasional situations where do-while affords simplified code.
  20.  
  21. -- part contents for background part 7
  22. ----- text -----
  23. 162